CC=gcc
LD=ld
AS=as
CFLAGS=-O -Wall -Wextra -ansi -nostdlib -fno-builtin -Iinclude
KERNIMG=kernel.bin
FPDRIVE=/home/mancha/os_dev/floppy

OBJS=loader.o system.o kernel.o 

all: $(KERNIMG)
	cp $(KERNIMG) $(FPDRIVE)/boot/
	sync

$(KERNIMG): $(OBJS)
	$(LD) -T linker.ld -o $(KERNIMG) $(OBJS)

%.o: include/%.h %.c
	$(CC) $(CFLAGS) -c -o $@ $*.c

.s.o:
	$(AS) -o $@ $<

clean:
	rm -f *.o $(KERNIMG)
